home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle: Internet utan modem / Internet CD.iso / web / computer / wwweps~1.com / adam / galactic.dcr / 00233.ls < prev    next >
Encoding:
Text File  |  1997-03-06  |  1.9 KB  |  72 lines

  1. on Encrypt theText
  2.   set c to "o76pURecB5xjQWN0;KPDbditFZufJVv319YE@I8rmMhqHA_wl-a!g,zsTyX:.nOSGC4kL2"
  3.   set encrypted to EMPTY
  4.   set asciiOff to 7
  5.   repeat with x = 1 to length(theText)
  6.     put EncryptChar(asciiOff, c, char x of theText) after encrypted
  7.     set num to charToNum(char x of theText)
  8.     set asciiOff to integer(char 1 of string(num))
  9.   end repeat
  10.   return encrypted
  11. end
  12.  
  13. on myOffSet theChar, theText
  14.   set textLen to length(theText)
  15.   set ascii to charToNum(theChar)
  16.   repeat with x = 1 to textLen
  17.     if charToNum(char x of theText) = ascii then
  18.       return x
  19.     end if
  20.   end repeat
  21.   return 0
  22. end
  23.  
  24. on Randomize
  25.   set chars to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:;.,_!-@"
  26.   set newChars to EMPTY
  27.   repeat while length(chars) > 0
  28.     set r to random(length(chars))
  29.     put char r of chars after newChars
  30.     delete char r of chars
  31.   end repeat
  32.   return newChars
  33. end
  34.  
  35. on EncryptChar off, chars, theChar
  36.   set charsLen to length(chars)
  37.   set w to myOffSet(theChar, chars)
  38.   if w > 0 then
  39.     if (w + off) <= charsLen then
  40.       set newChar to w + off
  41.     else
  42.       set newChar to w + off - charsLen
  43.     end if
  44.     return char newChar of chars
  45.   else
  46.     return theChar
  47.   end if
  48. end
  49.  
  50. on StripChar theText, badChar, goodChar
  51.   set w to offset(badChar, theText)
  52.   repeat while w > 0
  53.     put goodChar into char w of theText
  54.     set w to offset(badChar, theText)
  55.   end repeat
  56.   return theText
  57. end
  58.  
  59. on send
  60.   global name, email, city, state, country, score, level, today
  61.   if level = 20 then
  62.     set level to "10-Completed"
  63.   end if
  64.   set args to score & "," & level & "," & name & "," & email & "," & city & "," & state & "," & country & "," & today
  65.   set myscore to Encrypt(args)
  66.   if name = EMPTY then
  67.     gotonetpage("http://www.bznet.com/cgi-bin/game-land/galactic/savegalactic1.pl")
  68.   else
  69.     gotonetpage("http://www.bznet.com/cgi-bin/game-land/galactic/savegalactic1.pl?" & myscore)
  70.   end if
  71. end
  72.